package com.leetcode.LC;

import java.util.Arrays;

public class LC1502 {
    public boolean canMakeArithmeticProgression(int[] arr) {
        if (arr.length == 2) {
            return true;
        }
        Arrays.sort(arr);
        int tmp = arr[1] - arr[0];
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i + 1] - arr[i] != tmp) {
                return false;
            }
        }
        return true;
    }
}
